package com.qf.controller;

import com.qf.entity.Users;
import com.qf.service.UsersService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * 2019/10/9
 * Administrator
 * springboot1009
 * 面向对象面向君  不负代码不负卿
 */
@Controller
public class DemoController {
    @Resource
    private UsersService usersService;

    @RequestMapping("/getusers")
    public String test3(ModelMap map){
        List<Users> usersList = usersService.getall();
        map.addAttribute("ulist",usersList);
        return "showdemo";
    }

    //测试2
    @RequestMapping("/getusers2")
    public String test4(ModelMap map){
        List<Users> usersList = usersService.getall();
        map.addAttribute("ulist",usersList);
        return "show";
    }
}
